package com.bbcare.followup.plat.store.ibatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bbcare.followup.plat.entity.FollowQueue;

/*
 * @name:         队列信息存储接口
 * @author:       DemonLee
 * @createTime:   2017.4.12
 * @description:  队列基本信息
 * @modify:
 * 
 */
public interface IFollowQueueDAO {
    /**
     * 查询队列list
     * 
     * @param author_id
     * @return list
     */
    public List<FollowQueue> selectByAuthorid(HashMap<String, Object> paramMap) throws Exception;

    /**
     * 查询队列list
     * 
     * @param id
     * @return list
     */
    public List<FollowQueue> selectById(Map<String, Object> paramMap) throws Exception;

    /**
     * 查询队列list
     * 
     * @param authorId,tenantId,queueStatus,queueType${}
     * @return list
     */
    public List<FollowQueue> selectByAuthority(Map<String, Object> paramMap) throws Exception;

    // 队列查询列表页面
    public List<Map<String, Object>> selectQueueListByAuthority(Map<String, Object> paramMap) throws Exception;

    /**
     * 查询队列list<queueId>
     * 
     * @param authorId,tenantId,queueStatus,queueType${}
     * @return list
     */
    public List<FollowQueue> selectQueueIdByAuthority(Map<String, Object> paramMap) throws Exception;

    /**
     * 新建队列
     * 
     * @param queue
     * @return
     * @throws Exception
     */
    int saveQueue(FollowQueue queue) throws Exception;

    /**
     * 更新队列
     * 
     * @param queue
     * @return
     * @throws Exception
     */
    int updateQueue(FollowQueue queue) throws Exception;

    int updateQueueInfo(FollowQueue queue) throws Exception;

    /**
     * 转移患者队列 -1
     * 
     * @param queue
     * @return
     * @throws Exception
     */
    int updateQueueTransfer(FollowQueue queue) throws Exception;

    /**
     * 删除队列
     * 
     * @param paramMap
     * @return
     * @throws Exception
     */
    int deleteQueues(Map<String, Object> paramMap) throws Exception;

    /**
     * 分页查询队列时 查询队列总数
     * 
     * @param paramMap
     * @return
     * @throws Exception
     */
    int countByAuthorid(Map<String, Object> paramMap) throws Exception;

    /**
     * fu_queue_info表信息获取（redis缓存使用）
     * 
     * @param queueStatus
     * @return list
     */
    public List<Map<String, Object>> selectQueueInfo(Map<String, Object> paramMap) throws Exception;

    /**
     * 根据方案id查询队列list<queueId>
     * 
     * @param schemeId
     * @return list
     */
    public List<FollowQueue> selectBySchemeId(Map<String, Object> paramMap) throws Exception;

    /**
     * 根据科室id查询队列list
     * 
     * @param deptId
     * @return list
     */
    public List<FollowQueue> selectByDeptId(Map<String, Object> paramMap) throws Exception;
    
    /**
     * 根据科室id 查询科室默认队列信息
     * @param paramMap
     * @return
     * @throws Exception
     */
    public List<FollowQueue> selectDefaultQueueByDeptId(Map<String, Object> paramMap) throws Exception;
    
    public List<FollowQueue> selectQueueByAuthority(Map<String, Object> paramMap) throws Exception;

    public List<FollowQueue> selectQueueIdByparentId(Map<String, Object> paramMap) throws Exception;
    
    //查询队列级数据同步规则
    Map<String,Object> selectQueueDataRules(Map<String, Object> paramMap) throws Exception;
}
